/**
 * 
 * Nuxt.js 配置文件
 */
module.exports = {
    router:{
        linkActiveClass:"active",
        extendRoutes(routes, resolve) {
            //清楚 Nuxt.js 基于 pages 目录默认生成的路由表规则
          routes.splice(0)  
        //   routes.push({
        //     name: 'hello',
        //     path: '/hello',
        //     component: resolve(__dirname, 'pages/about.vue')
        //   })
           routes.push(...[
                {
                    // name: 'hello',
                    path: '/',
                    component: resolve(__dirname, 'pages/layout/'),
                    children: [
                      {
                        path: "",
                        component: resolve(__dirname, 'pages/home/'),
                        name: "home"
                      },
                      {
                        path: "/login",
                        component: resolve(__dirname, 'pages/login/'),
                        name: "login"
                      },
                      {
                        path: "/register",
                        component: resolve(__dirname, 'pages/login/'),
                        name: "register"
                      },
                      {
                        path: "/profile/:username",
                        component: resolve(__dirname, 'pages/profile/'),
                        name: "profile"
                      },
                      {
                        path: "/settings",
                        component: resolve(__dirname, 'pages/settings/'),
                        name: "settings"
                      },
                      {
                        path: "/editor",
                        component: resolve(__dirname, 'pages/editor/'),
                        name: "editor"
                      },
                      {
                        path: "/article/:slug",
                        component: resolve(__dirname, 'pages/article/'),
                        name: "article"
                      }
                    ]
                }
           ])
        }
    }
  }